package com.xing.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xing.config.properties.DatabaseServersProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Bradish7Y on 2017/8/21.
 */
@Configuration
@EnableConfigurationProperties(DatabaseServersProperties.class)
public class BaseConfig {

    /**
     * fasterxml.json 使用
     */
    @Bean
    public ObjectMapper ObjectMapper() {
        ObjectMapper objectMapper;
        objectMapper = new ObjectMapper();
        return objectMapper;
    }


//和上面一样
//    @Bean
//    @ConfigurationProperties(prefix = "xing")
//    public DatabaseServersProperties databaseServersProperties(){
//        return new DatabaseServersProperties();
//
//    }

}
